<?php

mysql_connect('localhost', 'root', '')
or die("Cannot connect to database\n");

mysql_select_db("db_web") or die(mysql_error());

mysql_query("SET AUTOCOMMIT=0");
mysql_query("START TRANSACTION");

$r1 = mysql_query("DELETE FROM Writers WHERE Id = 3");
or die(mysql_error());

$r2 = mysql_query("DELETE FROM Writers WHERE Id = 4");
or die(mysql_error());

if ($r1 and $r2 and $r3) {
  mysql_query("COMMIT");
} else {
  mysql_query("ROLLBACK");
}

mysql_close();

?>